package com.xcm.model.response;

/**
 * 相应编码
 *
 * @author 林强
 * @date 2018-04-12 11:15
 */
public enum MyHttpStatus {
    /**
     * 成功
     */
    OK(200, "OK"),
    /**
     * 失败
     */
    ERROR(201, "ERROR"),

    BAD_REQUEST(400, "Bad Request"),
    UNAUTHORIZED(401, "Unauthorized"),
    PAYMENT_REQUIRED(402, "Payment Required"),
    FORBIDDEN(403, "对不起，您无权访问，请先登录"),
    NOT_FOUND(404, "Not Found"),

    USER_NAME_ERROR(4000, "用户名为空或错误"),
    CAPTCHA_ERROR(4001, "验证码错误"),
    PASSWORD_ERROR(4002, "密码为空或错误"),
    SYSTEM_SIGN_ERROR(4003, "系统标志为空或错误"),
    USER_NOT_EXIST(4004, "用户名或密码错误"),
    NO_TOKEN(4005, "token未传"),
    TOKEN_ERROR(4006, "token错误"),
    TOKEN_EXPIRE(4007, "token超时"),
    TOKEN_SUCCESS(4008, "token验证成功"),
    TOKEN_FAILURE(4009, "token验证失败"),
    LOGIN_FAIL(4010, "登录失败"),

    SYSTEM_ERROR(5000, "系统异常");
    private final int code;
    private final String reasonPhrase;

    private MyHttpStatus(int code, String reasonPhrase) {
        this.code = code;
        this.reasonPhrase = reasonPhrase;
    }

    public int code() {
        return this.code;
    }

    public String getReasonPhrase() {
        return this.reasonPhrase;
    }
}
